/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2021年9月9日
 */
package com.massyframework.beanskin.license.signature.wizard;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import com.massyframework.beanskin.util.version.VersionRange;

/**
 * 模块
 * @author huangkh
 *
 */
public class Module {
	
	private String name;
	private String groupId;
	private String moduleId;
	private VersionRange versionRange;
		
	private String certAlias;
	private LocalDate expireDate;
	private List<Parameter> params;

	/**
	 * 
	 */
	public Module() {
		this.params = new ArrayList<>();
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the groupId
	 */
	public String getGroupId() {
		return groupId;
	}

	/**
	 * @param groupId the groupId to set
	 */
	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}
	
	public String getCoordinate() {
		return this.groupId.concat(":").concat(this.moduleId);
	}

	/**
	 * @return the moduleId
	 */
	public String getModuleId() {
		return moduleId;
	}

	/**
	 * @param moduleId the moduleId to set
	 */
	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	}

	/**
	 * @return the versionRange
	 */
	public VersionRange getVersionRange() {
		return versionRange;
	}

	/**
	 * @param versionRange the versionRange to set
	 */
	public void setVersionRange(VersionRange versionRange) {
		this.versionRange = versionRange;
	}
	
	
	
	/**
	 * 过期日期
	 * @return the exporeDate
	 */
	public LocalDate getExpireDate() {
		return expireDate;
	}

	/**
	 * 设置过期日期
	 * @param expireDate the expireDate to set
	 */
	public void setExpireDate(LocalDate expireDate) {
		this.expireDate = expireDate;
	}

	/**
	 * 参数
	 * @return
	 */
	public List<Parameter> getParameters(){
		return this.params;
	}
		
	/**
	 * 证书在keystore中的名称
	 * @return
	 */
	public String getCertAlias() {
		return this.certAlias;
	}
	
	/**
	 * 设置证书名称
	 * @param value {@link String}
	 */
	public void setCertAlias(String value) {
		this.certAlias = value;
	}

	@Override
	public String toString() {
		return "Module [name=" + name + ", groupId=" + groupId + ", moduleId=" + moduleId + ", versionRange="
				+ versionRange + "]";
	}
}
